package comply.zyc;

import java.sql.*;

/**
 * @description:
 * @author: ZhaoYicong
 * @date: Created in 2020/6/21 22:48
 * @version: v1.0
 * @modified By:
 */
public class Ku {
    public static Connection getConnection() {
        //  和自己的数据库建立链接
        Connection connection=null;
        try {
//貌似是基本格式，我照着师兄的敲的
            Class.forName("com.mysql.cj.jdbc.Driver");
             connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/test?useSSL=false&serverTimezone=Asia/Shanghai"+"&characterEncoding=utf8", "root", "1234");



        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        }

        return connection;

    }
}
